<?php

/**
 * Privacy information page
 *
 * Shopalong, the open source shopping system
 * http://shopalong.blogspot.com/
 *
 * @author Stuart Metcalfe <shoopdev@gmail.com>
 * @copyright Copyright &copy; 2006, Shopalong
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 */

require('includes/application_top.php');
$eventManager->registerEvent('ProductViewed', 'onProductViewed');
$product = new Product($HTTP_GET_VARS['products_id']);

if (!$product->exists())
{
	$theme->config_load('product_info.conf');
	$theme->display('generic.tpl');
}

else
{
	$params = array('products_id'=>$product->getId());
	$eventManager->fireEvent('ProductViewed', $params);
	
	/**
	 * @todo Product view increments can now be done by event notification as a
	 * plugin.
	 */
	$product->incrementViews();
	$theme->assign('product', $product);
	$theme->display('product_info.tpl');
}

require(DIR_WS_INCLUDES.'application_bottom.php');

?>
